RP2040_PWM #124447
Replies: 4 comments
-
To use a PWM B pin on the RP2040 as an input to divide a 10 MHz clock signal by 100, follow these steps:
|
Beta Was this translation helpful? Give feedback.
-
Thank your for your reply. I have written code that uses the internal clock and that works fine. The problem is I can't find a way of using an external clock connected to an input pin. Could you please advise how to designate an input pin. |
Beta Was this translation helpful? Give feedback.
-
Identify the Clock Pin: Check the microcontroller’s datasheet to find the pin designated for external clock input (e.g., XTAL1, CLKIN). Configure the Pin as Input: Ensure the pin is set as an input in your microcontroller’s configuration settings. Disable Internal Clock: Turn off the internal clock if needed, so it doesn't interfere with the external clock. Enable External Clock: Enable the external clock source through your microcontroller's clock configuration settings. Set Clock Source: Configure the microcontroller to use the external clock as the system clock source. Verify Configuration: Check that the microcontroller is correctly using the external clock by verifying through any available status registers or debugging tools. |
Beta Was this translation helpful? Give feedback.
-
I've been able to write some C code that uses the Pico PWM components to divide an external clock by 100. I've written this by including pwm.h, using both Visual Studio Code and Arduino IDE V2.3.2. I've checked the quality of the divided clock using a spectrum analyzer and comparing its divided clock with the input clock divided by 100 using a 74HC390. There is no degradation using the Pico. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
The RP2040_PWM code works fine for me but I would like to use PWM B pin as an input. On that input I will put a 10 MHz highly accurate clock and divide it by 100. I can't see a way of using PWM B pin as an input. Is anyone aware of how to do this please.
Beta Was this translation helpful? Give feedback.
All reactions